home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_08
/
9n08014b
< prev
next >
Wrap
Text File
|
1991-07-08
|
579b
|
24 lines
/* frexp function */
#include "xmath.h"
double (frexp)(double x, int *pexp)
{ /* compute frexp(x, &i) */
short binexp;
switch (_Dunscale(&binexp, &x))
{ /* test for special codes */
case NAN:
case INF:
errno = EDOM;
*pexp = 0;
return (x);
case 0:
*pexp = 0;
return (0.0);
default: /* finite */
*pexp = binexp;
return (x);
}
}